package com.iotproject.forumservice.mapper;

import com.iotproject.forumservice.entity.ForumQuestion;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 论坛问题 Mapper 接口
 * </p>
 *
 * @author testjava
 * @since 2023-04-09
 */
public interface ForumQuestionMapper extends BaseMapper<ForumQuestion> {
    List<ForumQuestion> getAllListByPage(@Param("page") Integer page, @Param("size") Integer size);
    void increaseViewCount(@Param("questionId") String questionId);
    void increaseCommentCount(@Param("questionId") String questionId);
    void increaseLikeCount(@Param("questionId") String questionId);
    void decreaseLikeOperator(@Param("questionId") String questionId);
    List<ForumQuestion> relatedQuestion(@Param("questionId")String questionId, @Param("tags") String tags);
    void updateQuestion(@Param("id") String id, @Param("title") String title, @Param("description") String description, @Param("tag") String tag);
    List<ForumQuestion> hotTopic(@Param("condition") String condition);
    List<ForumQuestion> questionListByKeyWords(@Param("keyWords") String keyWords, @Param("page") Integer page, @Param("size") Integer size);
    List<ForumQuestion> questionListByUserId(@Param("userId") String userId, @Param("page") Integer page, @Param("size") Integer size);
}
